<template>
    <div>

        <el-dialog
                title="修改"
                :visible.sync="dialogVisible"
                width="30%"
        ><el-form :label-position="labelPosition"  label-width="80px"  :inline="true"  class="demo-form-inline">
            <el-form-item label="参数标识:">
                <el-input v-model="csbs"  placeholder="请输入参数标识"></el-input>
            </el-form-item>
            <el-form-item label="参数值:">
                <el-select v-model="csz" placeholder="请选择参数值">
                    <el-option
                            v-for="item in options"
                            :key="item.value"
                            :label="item.label"
                            :value="item.value">
                    </el-option>
                </el-select>
            </el-form-item>
            <el-form-item label="参数标识说明:">
                <el-input type="textarea" v-model="csbssm"  placeholder="参数标识说明"></el-input>
            </el-form-item>
            <el-form-item label="备注:">
                <el-input type="textarea" v-model="bz"  placeholder="备注"></el-input>
            </el-form-item>
        </el-form>
            <span slot="footer" class="dialog-footer">
            <el-button @click="dialogVisible = false">取 消</el-button>
            <el-button type="primary" @click="update">确 定</el-button>
          </span>
        </el-dialog>

    </div>
</template>

<script>
    import {update} from '@/api/app/xtgl/xtcs/xtcs.js'
    export default {
        data(){
            return{
                labelPosition: 'right',
                dialogVisible:false,                                //定义弹框隐藏
                csbs:'',
                csbssm:'',
                bz:'',
                options: [{
                    value: 'cs1',
                    label: '系统参数1'
                }, {
                    value: 'cs2',
                    label: '系统参数2'
                }],
                csz: ''
            }
        },
        methods:{
            async update(){
                let parms ={
                    csbs:this.csbs,
                    csbssm:this.csbssm,
                    bz:this.bz,
                    csz:this.csz,
                }
                let data = await update(parms)
                this.$emit('findListByPage')                 //为父类自定义标签引用，刷新列表数据
                this.hidden()
            },

            show(){
                this.dialogVisible = true
            },
            hidden(){
                this.dialogVisible = false
            },
        },
    }
</script>

<style scoped>

</style>